package com.eddie.community.service;

import com.eddie.community.entity.DiscussPost;
import com.eddie.community.entity.Page;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * Description:帖子服务接口
 * Date: 2021/2/27 0027 15:34
 * Author: Eddie.Zhan
 * Email: eddie_zhan@yeah.net
 */
public interface DiscussPostService {
    /***
     * Description: 查询帖子
     * @params [userId]
     * @return int
     * @date 2021/2/27 0027 15:36
     * @Author Eddie.Zhan
     */
    int findDiscussPostRows(int userId);

    /***
     * Description: 分也查询
     * @params [userId, offset, limit]
     * @return java.util.List<com.eddie.community.entity.DiscussPost>
     * @date 2021/2/27 0027 15:37
     * @Author Eddie.Zhan
     */
    List<DiscussPost> findDiscussPosts(int userId, int offset, int limit,int orderMode);

    /***
     * Description: 新增帖子
     * @params [post]
     * @return int
     * @date 2021/2/27 0027 15:38
     * @Author Eddie.Zhan
     */
    int addDiscussPost(DiscussPost post);

    /**
     * Description: 更新正文
     *
     * @return int
     * @params [id, commentCount]
     * @date 2021/2/27 0027 23:46
     * @Author Eddie.Zhan
     */
    int updateCommentCount(int id, int commentCount);

    /**
     * Description: 根据id查询帖子
     *
     * @return com.eddie.community.entity.DiscussPost
     * @params [id]
     * @date 2021/2/27 0027 23:46
     * @Author Eddie.Zhan
     */
    DiscussPost findDiscussPostById(int id);

    //更新帖子类型
    int updateType(int id, int type);

    //更新帖子状态
    int updateStatus(int id, int status);

    //更新帖子分数
    int updateScore(int id, double score);
}
